package com.lry.pda.bottom.c.backend.executor;

import com.lry.pda.bottom.c.backend.code.CodeKey;
import com.lry.pda.bottom.c.backend.code.CodeNode;
import com.lry.pda.bottom.c.frontend.Grammar;

public class ExprExecutor extends BaseExecutor{
    @Override
    public void execute(CodeNode root) {
        executeChildren(root);
        int production = (int) root.getAttr(CodeKey.PRODUCTION);
        if (production == Grammar.NoCommaExpr_TO_Expr) {
            copyChild(root, root.getChildren().get(0));
        }
    }
}
